package yhao.demo.service.erp.workflow.apilist.form.flow;

import io.swagger.annotations.ApiModelProperty;
import org.hibernate.validator.constraints.NotBlank;
import org.hibernate.validator.constraints.NotEmpty;
import yhao.demo.service.erp.workflow.apilist.enums.flow.ProcessDefinitionStatus;
import yhao.demo.service.erp.workflow.apilist.enums.task.TaskBizCode;
import yhao.infra.apilist.validate.IdUnForm;

import javax.validation.Valid;
import java.util.List;

public class FlowProcessDefinitionForm extends IdUnForm {
    @ApiModelProperty(value = "流程名称",required = true)
    @NotBlank(message = "请输入流程名称")
    private String name;

    @ApiModelProperty(value = "节点",required = true)
    @NotEmpty(message = "至少添加一个节点")
    @Valid
    private List<FlowNodeForm> nodes;

    @ApiModelProperty(value = "连接线",required = true)
    @NotEmpty(message = "至少添加一条连接线")
    @Valid
    private List<FlowTransitionForm> trans;

    @ApiModelProperty(value = "状态")
    private ProcessDefinitionStatus status = ProcessDefinitionStatus.ENABLED;

    @ApiModelProperty(value = "业务编码，与bizCodeStr之一不可为空，两者皆存在优先使用bizCode")
    private TaskBizCode bizCode;

    @ApiModelProperty(value = "业务编码自定义，与bizCode之一不可为空，两者皆存在优先使用bizCode")
    private String bizCodeStr;

    public List<FlowNodeForm> getNodes() {
        return nodes;
    }

    public void setNodes(List<FlowNodeForm> nodes) {
        this.nodes = nodes;
    }

    public List<FlowTransitionForm> getTrans() {
        return trans;
    }

    public void setTrans(List<FlowTransitionForm> trans) {
        this.trans = trans;
    }

    public ProcessDefinitionStatus getStatus() {
        return status;
    }

    public void setStatus(ProcessDefinitionStatus status) {
        this.status = status;
    }

    public TaskBizCode getBizCode() {
        return bizCode;
    }

    public void setBizCode(TaskBizCode bizCode) {
        this.bizCode = bizCode;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getBizCodeStr() {
        return bizCodeStr;
    }

    public void setBizCodeStr(String bizCodeStr) {
        this.bizCodeStr = bizCodeStr;
    }
}
